package com.demo.cms.dao.impl;

import java.util.Map;

import com.demo.cms.dao.ArticleExtendDao;
import com.demo.cms.model.ArticleExtend;
import com.demo.core.dao.impl.base.BaseCoreDaoSupport;
import com.demo.core.model.support.GeneralExecuteModel;

/**
 * 文章扩展属性数据访问实现类
 * 
 * @author ryuu.kk
 *
 */
public class ArticleExtendDaoImpl extends BaseCoreDaoSupport<ArticleExtend, Long>  implements ArticleExtendDao {

	/**
	 * 目录空间 
	 */
	protected final static String ARTICLE_EXTEND_SPACE = "articleExtendSpace.";
	/**
	 * 模型表名
	 */
	protected final static String TABLE_NAME = "T_CMS_ARTICLE_EXTEND";
	/**
	 * 模型表主键ID
	 */
	protected final static String TABLE_PK_NAME = "ID";
	
	@Override
	protected String nameSpace() {
		return ARTICLE_EXTEND_SPACE;
	}

	@Override
	protected void doInit(GeneralExecuteModel<Long> model) {
		model.setPk(TABLE_PK_NAME);
		model.setTable(TABLE_NAME);
	}

	@Override
	public int updateEnabled(ArticleExtend articleExtend, Map<String, Object> params) {
		params.put("articleExtend", articleExtend);
		return getSqlMapClientTemplate().update(nameSpace() + "changeEnabled", params);
	}
}
